import tkinter as tk

import customtkinter as ctk

from Attriabte import Color
from Entiy.WordGroup import WordGroup
from View.WindowComponent.BodyFrame.BodyFrame import BodyFrame
from View.WindowComponent.BodyFrame.reviewWord import ReviewWord

wg = WordGroup()


class SelectWord(BodyFrame):
    def pack(self):
        self.basicTheme("学习 - 选择单词")

        def click():
            self.layout.body(frame=ReviewWord(self.layout, listbox.get(), self.ws).get(), must_do=True)
            print("heii")

        tk.Label(self.inner_frame, text='选择你的词组', font=('黑体', 20), **self.attribate_basic).pack(pady=12)
        listbox = ctk.CTkOptionMenu(self.inner_frame, text_font=("仿宋", 14), values=wg.get_all_group(), width=200)
        listbox.pack(pady=12)
        ctk.CTkButton(
            self.inner_frame,
            text='确认',
            command=lambda: click(),
            **self.attribate_basic
        ).pack(pady=12)
